<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

<title>svn-buildpackage - maintaining Debian packages with Subversion - Command reference</title>

</head>

<body>

<p><a name="ch-reference"></a></p>
<hr>

<p>
[ <a href="ch-tasks.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-intro.html">1</a> ]
[ <a href="ch-start.html">2</a> ]
[ <a href="ch-import.html">3</a> ]
[ <a href="ch-tasks.html">4</a> ]
[ 5 ]
[ <a href="ch-misc.html">6</a> ]
[ <a href="ch-misc.html">next</a> ]
</p>

<hr>

<h1>
svn-buildpackage - maintaining Debian packages with Subversion
<br>Chapter 5 - Command reference
</h1>

<hr>

<hr>

<h2><a name="s5.1"></a>5.1 svn-inject</h2>

<hr>

<h3><a name="s5.1.1"></a>5.1.1 NAME</h3>

<p>
svn-inject - puts a Debian source package into Subversion repository
</p>

<hr>

<h3><a name="s5.1.2"></a>5.1.2 SYNOPSIS</h3>

<p>
<em>svn-inject [options] &lt;package&gt;\&amp;.dsc &lt;repository URL&gt;</em>
</p>

<hr>

<h3><a name="s5.1.3"></a>5.1.3 &quot;OPTIONS&quot;</h3>

<p>
<em>svn-inject</em> accepts the following options on the command-line:
</p>

<p>
<em>[ -h ]</em> print the help menu
</p>

<p>
<em>[ -v ]</em> Make the command verbose
</p>

<p>
<em>[ -q ]</em> Hide less important messages
</p>

<p>
<em>[ -l ]</em> Layout type.  1 (default) means
package/{trunk,tags,branches,...} scheme, 2 means the
{trunk,tags,branches,...}/package scheme.  2 is not implemented yet.
</p>

<p>
<em>[ -t directory ]</em> Specify the directory where the .orig.tar.gz files
are stored on the local machine.
</p>

<p>
<em>[ -d | --do-like=directory ]</em> Looks at the working directory of some
other package and uses its base URL, tarball storage directory and similar
checkout target directory.
</p>

<p>
<em>[ -c number ]</em> Checkout nothing (0), trunk directory (1) or everything
(2) when the work is done.
</p>

<p>
<em>[ -O | --no-branches ]</em> Do not create the 'branches' subdirectory at
all.  This works similar to -o but all changes on upstream files (eg.  meta
changes like updating the config.guess and config.sub files) are ignored and
the upstream branch is not used.
</p>

<hr>

<h2><a name="s-sbman"></a>5.2 svn-buildpackage</h2>

<hr>

<h3><a name="s5.2.1"></a>5.2.1 NAME</h3>

<p>
svn-buildpackage - build Debian packages from SVN repository
</p>

<hr>

<h3><a name="s5.2.2"></a>5.2.2 SYNOPSIS</h3>

<p>
<em>svn-buildpackage [ OPTIONS...  ] [ OPTIONS for dpkg-buildpackage ]</em>
</p>

<hr>

<h3><a name="s5.2.3"></a>5.2.3 &quot;DESCRIPTION&quot;</h3>

<p>
Builds a Debian package from a Subversion repository.  The source code
repository must be in the format created by svn-inject, and this script must be
executed from the working directory (trunk/package).
</p>

<p>
By default, the working directory is used as the main source directory
(assuming the whole upstream source is being stored in the repository).  The
alternative is so called &quot;merge mode&quot;.  With this method, only the
debian directory (and maybe some other modified files) are stored in the
repository.  At build time, the contents of the svn trunk are copied to the
extracted tarball contents (and can overwrite parts of it).  To choose this
working model, set the svn property mergeWithUpstream on the Debian directory
(&quot;svn propset mergeWithUpstream 1 debian&quot;).
</p>

<p>
The default behaviour is as follows:
</p>

<p>
Check the working directory, complain on uncommited files (also see
<em>--svn-ignore-new</em> )
</p>

<p>
Copy the orig tarball to the build area if necessary (also see
<em>--svn-no-links</em> )
</p>

<p>
Extract the tarball (in merge mode) or export the svn work directory to the
build directory (also see below and <em>--svn-no-links</em> )
</p>

<p>
Build with dpkg-buildpackage (also see <em>--svn-builder</em> ,
<em>--svn-lintian</em> , etc.)
</p>

<p>
Create a changelog entry for the future version
</p>

<hr>

<h3><a name="s5.2.4"></a>5.2.4 &quot;OPTIONS&quot;</h3>

<p>
<em>svn-buildpackage</em> accepts the following options on the command-line:
</p>

<p>
<em>[ --svn-builder=COMMAND ]</em> Specifies alternative build command instead
of dpkg-buildpackage, eg.  debuild, pdebuild, etc.  Every parameters that
svn-buildpackage doesn't know ( <em>--svn-*</em> ) are passed to COMMAND.
There is no difference between the command line and config file parameters .
They are used at the same time.  WARNING: shell quotation rules do not
completely apply here, better use wrappers for complex constructs.  Using this
option may break <em>--svn-lintian</em> , <em>--svn-linda</em> and
<em>--svn-move</em> functionality.  Some functions may be disabled when a
custom build command is used because the output file location is not
predictable.
</p>

<p>
<em>[ --svn-ignore-new | --svn-ignore ]</em> Don't stop on svn conflicts or
new/changed files.  To set this behaviour for single files set the
&quot;deb:ignoreM&quot; property to 1 on them.  Also see documentation of the
svn:ignore property in the SVN book.
</p>

<p>
<em>[ --svn-dont-clean ]</em> Don't run debian/rules clean (default: clean
first)
</p>

<p>
<em>[ --svn-no-links ]</em> Don't use file links but try to export or do hard
copies of the working directory (default: use links where possible).  This is
useful if your package fails to build because some files, empty directories,
broken links, ...  cannot not be transported with in the default link-copy
mode.
</p>

<p>
<em>[ --svn-dont-purge ]</em> Don't remove the build directory when the build
is done.  (Default: remove after successful build)
</p>

<p>
<em>[ --svn-reuse ]</em> If possible, reuse an existing build directory in
subsequent builds.  The build directory is not purged after the build, it is
not renamed when a build starts and the files are just copied over into it.
Useful in mergeWithUpstream mode with large packages.
</p>

<p>
<em>[ --svn-export ]</em> Just export the working directory and do neccessary
code merge operations, then exit.
</p>

<p>
<em>[ --svn-tag ]</em> Final build: Tag, export, build cleanly &amp; make new
changelog entry
</p>

<p>
<em>[ --svn-tag-only | --svn-only-tag ]</em> Don't build the package, do only
the tag copy
</p>

<p>
<em>[ --svn-retag ]</em> If an existing target directory has been found while
trying to create the tag copy, remove the target directory first.
</p>

<p>
<em>[ --svn-tag ]</em> Final build: Tag, export, build cleanly &amp; make new
changelog entry
</p>

<p>
<em>[ --svn-noautodch ]</em> No new Debian changelog entry is added
automatically.
</p>

<p>
<em>[ --svn-lintian | --svn-linda ]</em> Run lintian or linda on the resulting
changes file when done.
</p>

<p>
<em>[ --svn-move ]</em> When done, move the created files (as listed in
.changes) to the parent directory, relative to the one where svn-buildpackage
was started.
</p>

<p>
<em>[ --svn-move-to=...  ]</em> Specifies the target directory to move
generated files to.
</p>

<p>
<em>[ --svn-pkg=packagename ]</em> Overrides the detected package name.  Use
with caution since it could be set too late during the processing (eg.  still
have the old value when expanding shell variables).
</p>

<p>
<em>[ --svn-override=var=value,anothervar=value ]</em> Overrides any config
variable that has been autodetected or found in .svn/deb-layout.
</p>

<p>
<em>[ --svn-prebuild | --svn-postbuild | --svn-pretag | --svn-posttag ]</em>
Commands (hooks) to be executed before/after the build/tag command invocations,
e.g.  to download the orig tarballs from the archive.  Shell code can be emdded
here though it is not recommended.  Various helping variables are available in
the environment, see ENVIRONMENT VARIABLES below for detailed explanation.
</p>

<p>
<em>[ --svn-noninteractive ]</em> With this parameter svn-buildpackage will not
interact with the user
</p>

<p>
<em>[ --svn-verbose ]</em> More verbose program output
</p>

<p>
<em>[ -h | --help ]</em> Show the help message
</p>

<hr>

<h3><a name="s5.2.5"></a>5.2.5 &quot;CONFIGURATION FILE&quot;</h3>

<p>
svn-buildpackage's behaviour can be modified using the file
~/.svn-buildpackage.conf.  Additional parts can be added in each package
working directory using the file .svn/svn-buildpackage.conf.  It is essentially
a list of the long command line options (without leading minus signs), one
argument per line (without quotes surrounding multi-word arguments).  The
variables are expanded with the system shell if shell variables are found
there.  Avoid ~ sign because of unreliable expansion: it is better to use $HOME
instead.  Example: .nf svn-builder=debuild -EPATH svn-no-links
svn-override=origDir=$HOME/debian/upstream/$PACKAGE # svn-ignore-new
#svn-lintian .fi
</p>

<hr>

<h3><a name="s5.2.6"></a>5.2.6 &quot;DIRECTORY LAYOUT HANDLING&quot;</h3>

<p>
By default, <em>svn-buildpackage</em> expects a configuration file with
path/url declaration, .svn/deb-layout.  The values there can be overridden with
the <em>--svn-override</em> option, see above.  If a config file could not be
found, the settings are autodetected following the usual assumptions about
local directories and repository layout.  In addition, the contents of a custom
file <em>debian/svn-deblayout</em> will be imported during the initial
configuration.  Package maintainers can store this file in the repository to
pass correct defaults to new svn-buildpackage users.  The format is the same as
in the file <em>\&amp;.svn/deb-layout</em> \&amp;.  As an alternative to the
<em>debian/svn-deblayout</em> file, maintainers can set Subversion properties
for the <em>debian/</em> directory; any properties of <em>debian/</em> which
have a name of the form <em>svn-bp:PROP</em> will be the source of a PROP
setting which has the value indicated by the first line of the property value.
</p>

<hr>

<h3><a name="s5.2.7"></a>5.2.7 &quot;ENVIRONMENT VARIABLES&quot;</h3>

<p>
The following environment variables are exported by svn-buildpackage and can be
used in hook commands or the package build system.
</p>

<p>
<em>PACKAGE</em>
</p>

<p>
<em>package</em> The source package name
</p>

<p>
<em>SVN_BUILDPACKAGE</em> Version of svn-buildpackage
</p>

<p>
<em>TAG_VERSION</em>
</p>

<p>
<em>debian_version</em> The complete Debian version string, also used for the
tag copy
</p>

<p>
<em>non_epoch_version</em> Same as debian_version but without any epoch strings
</p>

<p>
<em>upstream_version</em> Same as debian_version but without Debian extensions
</p>

<p>
<em>guess_loc</em> Guessed upstream source package name in the pool, something
like libm/libmeta-html-perl_3.2.1.0.orig.tar.g
</p>

<p>
<em>DIFFSRC</em> (experimental) shows the location of generated diff file
</p>

<p>
The following variables are understood by svn-buildpackage:
</p>

<p>
<em>FORCETAG</em> Ignore the signs of an incomplete changelog and tag the
repository anyway
</p>

<p>
<em>FORCEEXPORT</em> Export upstream source from the repository even if
mergeWithUpstream property is set
</p>

<p>
<em>DEBIAN_FRONTEND</em> If DEBIAN_FRONTEND is set to 'noninteractive'
<em>--svn-noninteractive</em> is called silently
</p>

<hr>

<h3><a name="s5.2.8"></a>5.2.8 &quot;RECOMMENDATIONS&quot;</h3>

<p>
Use shell aliases.  Here are some examples for Bash: .nf alias
svn-b=&quot;svn-buildpackage -us -uc -rfakeroot --svn-ignore&quot;; alias
svn-br=&quot;svn-b --svn-dont-purge --svn-reuse&quot;; alias
svn-bt=&quot;svn-buildpackage --svn-tag -rfakeroot&quot;; .fi
</p>

<p>
Those commands have respective meanings: build regardless of new or changed
files; build regardless of new or changed files and reuse the build directory;
build (for upload) and tag.
</p>

<p>
SSH is the easiest way to access remote repositories, although it usually
requires entering a password more frequently with svn-buildpackage.
Workarounds include using an ssh key without a passphrase (although this is
insecure and still relatively slow), or the SSH connection caching feature
present in recent versions of SSH.  For details, see the svn-buildpackage
manual.
</p>

<p>
Another way to get a remote link is using the Subversion DAV module (with SSL
and Apache user authentication), see the svn-buildpackage HOWTO manual for
details.
</p>

<hr>

<h2><a name="s5.3"></a>5.3 svn-upgrade</h2>

<hr>

<h3><a name="s5.3.1"></a>5.3.1 NAME</h3>

<p>
svn-upgrade - upgrade source package from a new upstream revision
</p>

<hr>

<h3><a name="s5.3.2"></a>5.3.2 SYNOPSIS</h3>

<p>
<em>svn-upgrade</em>
</p>

<hr>

<h3><a name="s5.3.3"></a>5.3.3 &quot;DESCRIPTION&quot;</h3>

<p>
<em>svn-upgrade</em> modifies a Debian package source located in a Subversion
repository, upgrading it to a new upstream release.  The repository filesystem
tree must be in the format created by svn-inject.
</p>

<hr>

<h3><a name="s5.3.4"></a>5.3.4 &quot;OPTIONS&quot;</h3>

<p>
<em>svn-upgrade</em> accepts the following options on the command-line:
</p>

<p>
<em>[ -V STRING | --version STRING ]</em> Forces a different upstream version
string
</p>

<p>
<em>[ -c | --clean ]</em> Runs &quot;make clean&quot; and removes the debian/
directory in the new source.
</p>

<p>
<em>[ -P STRING | --packagename STRING ]</em> Forces a different package name
</p>

<p>
<em>[ -v | --verbose ]</em> More verbose program output
</p>

<p>
<em>[ -r | --replay-conflicting ]</em> Extra cleanup run: replaces all
conflicting files with upstream versions.  Review of &quot;svn status&quot;
output before doing that could make sense.
</p>

<p>
<em>[ -N | --noautodch ]</em> Upgrade without making a new changelog entry.
</p>

<p>
<em>[ --noninteractive ]</em> Turn off interactive mode.
</p>

<p>
<em>[ --ignoreerrors ]</em> In noninteractive mode, ignore errors.
</p>

<p>
Tarballs must be compressed with gzip or bzip2.
</p>

<hr>

<p>
[ <a href="ch-tasks.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-intro.html">1</a> ]
[ <a href="ch-start.html">2</a> ]
[ <a href="ch-import.html">3</a> ]
[ <a href="ch-tasks.html">4</a> ]
[ 5 ]
[ <a href="ch-misc.html">6</a> ]
[ <a href="ch-misc.html">next</a> ]
</p>

<hr>

<p>
svn-buildpackage - maintaining Debian packages with Subversion
</p>

<address>
$LastChangedDate: 2005-09-23 16:17:33 +0200 (Fr, 23 Sep 2005) $<br>
<br>
Eduard Bloch<br>
<br>
</address>
<hr>

</body>

</html>

